/**
 * Jaxson ajax
 *
 * Copyright Remedy Interactive, licensed under Apache version 2 license:
 *
 *  http://www.apache.org/licenses/LICENSE-2.0.html
 *
 * This notice must remain in all java source files.
 */
package org.jaxson.struts.postprocessor;


import javax.servlet.http.HttpSession;

/**
 * A single thread for running a PostRequestProcessor
 * 
 * @see org.jaxson.struts.postprocessor.PostRequestProcessor
 * @see org.jaxson.struts.postprocessor.PostProcessorThreadGroup
 * 
 * @author Joe Maisel
 */
public class PostRequestProcessorThread extends Thread
{
	private PostRequestProcessor handler;

	public PostRequestProcessorThread (HttpSession session, PostRequestProcessor prp)
	{
		this( session, prp, null );
	}

	public PostRequestProcessorThread (HttpSession session, PostRequestProcessor prp, String name)
	{
		super( PostProcessorThreadGroup.getInstance(), prp, session.getId() + (null == name ? prp.getClass().getName() : name) );
		this.handler = prp;
	}

	/**
	 * @return the handler
	 */
	public PostRequestProcessor getHandler()
	{
		return handler;
	}

	/**
	 * @param handler
	 *            the handler to set
	 */
	public void setHandler( PostRequestProcessor handler )
	{
		this.handler = handler;
	}
}
